package cn.com.dashihui.web;

import java.util.Map;
import java.util.Properties;

import com.google.common.collect.Maps;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.core.Const;
import com.jfinal.ext.handler.ContextPathHandler;
import com.jfinal.ext.interceptor.SessionInViewInterceptor;
import com.jfinal.ext.plugin.shiro.ShiroInterceptor;
import com.jfinal.ext.plugin.shiro.ShiroPlugin;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
import com.jfinal.plugin.c3p0.C3p0Plugin;
import com.jfinal.plugin.ehcache.EhCachePlugin;
import com.jfinal.render.ViewType;
import com.jfinal.template.Engine;
import com.jfinal.weixin.sdk.api.ApiConfig;
import com.jfinal.weixin.sdk.api.ApiConfigKit;

import cn.com.dashihui.web.controller.APIController;
import cn.com.dashihui.web.controller.AdController;
import cn.com.dashihui.web.controller.AdminController;
import cn.com.dashihui.web.controller.AuthDownloadController;
import cn.com.dashihui.web.controller.BabyController;
import cn.com.dashihui.web.controller.BestSellingController;
import cn.com.dashihui.web.controller.CategoryController;
import cn.com.dashihui.web.controller.ChangeDeliveryController;
import cn.com.dashihui.web.controller.ChangeMoneyController;
import cn.com.dashihui.web.controller.ChangeSyncController;
import cn.com.dashihui.web.controller.CityController;
import cn.com.dashihui.web.controller.ContentsAssistCategoryController;
import cn.com.dashihui.web.controller.ContentsAssistController;
import cn.com.dashihui.web.controller.ContentsCategoryController;
import cn.com.dashihui.web.controller.ContentsReportController;
import cn.com.dashihui.web.controller.ContentsSelectedController;
import cn.com.dashihui.web.controller.ContentsSubjectController;
import cn.com.dashihui.web.controller.ContentsTopicController;
import cn.com.dashihui.web.controller.EcardGoodsController;
import cn.com.dashihui.web.controller.EcardOrderController;
import cn.com.dashihui.web.controller.ExchangeGoodsController;
import cn.com.dashihui.web.controller.ExchangeOrderController;
import cn.com.dashihui.web.controller.GoodsBaseController;
import cn.com.dashihui.web.controller.GoodsStoreController;
import cn.com.dashihui.web.controller.GoodsTagController;
import cn.com.dashihui.web.controller.OrderController;
import cn.com.dashihui.web.controller.PrefController;
import cn.com.dashihui.web.controller.ResourceController;
import cn.com.dashihui.web.controller.RoleController;
import cn.com.dashihui.web.controller.SMSController;
import cn.com.dashihui.web.controller.SellerController;
import cn.com.dashihui.web.controller.SellerTongController;
import cn.com.dashihui.web.controller.SpikeListController;
import cn.com.dashihui.web.controller.SpikeRecommendController;
import cn.com.dashihui.web.controller.SpikeTimeController;
import cn.com.dashihui.web.controller.StoreController;
import cn.com.dashihui.web.controller.StoreTongController;
import cn.com.dashihui.web.controller.SysConfigController;
import cn.com.dashihui.web.controller.SystemController;
import cn.com.dashihui.web.controller.UserController;
import cn.com.dashihui.web.controller.UserDataController;
import cn.com.dashihui.web.controller.UserMoneyController;
import cn.com.dashihui.web.controller.VideoGoodsController;
import cn.com.dashihui.web.controller.VideoOrderController;
import cn.com.dashihui.web.controller.WebJoinController;
import cn.com.dashihui.web.controller.WebNoticeController;
import cn.com.dashihui.web.controller.WxArticleCategoryController;
import cn.com.dashihui.web.controller.WxArticleController;
import cn.com.dashihui.web.controller.WxArticleOutputController;
import cn.com.dashihui.web.controller.WxGoodsTitleController;
import cn.com.dashihui.web.controller.WxHomeWindowController;
import cn.com.dashihui.web.controller.WxStrategyController;
import cn.com.dashihui.web.dao.Ad;
import cn.com.dashihui.web.dao.AdSeller;
import cn.com.dashihui.web.dao.Admin;
import cn.com.dashihui.web.dao.AuthDownload;
import cn.com.dashihui.web.dao.Baby;
import cn.com.dashihui.web.dao.BabyTitle;
import cn.com.dashihui.web.dao.Category;
import cn.com.dashihui.web.dao.City;
import cn.com.dashihui.web.dao.ContentsAssist;
import cn.com.dashihui.web.dao.ContentsAssistCategory;
import cn.com.dashihui.web.dao.ContentsCategory;
import cn.com.dashihui.web.dao.ContentsSubject;
import cn.com.dashihui.web.dao.DeatiImage;
import cn.com.dashihui.web.dao.DetailsImg;
import cn.com.dashihui.web.dao.ExchangeOrder;
import cn.com.dashihui.web.dao.ExchangeOrderLog;
import cn.com.dashihui.web.dao.Feedback;
import cn.com.dashihui.web.dao.GSR;
import cn.com.dashihui.web.dao.GbOrder;
import cn.com.dashihui.web.dao.GoodsBaseImages;
import cn.com.dashihui.web.dao.GoodsEcard;
import cn.com.dashihui.web.dao.GoodsEge;
import cn.com.dashihui.web.dao.GoodsEgeSpec;
import cn.com.dashihui.web.dao.GoodsItem;
import cn.com.dashihui.web.dao.GoodsSale;
import cn.com.dashihui.web.dao.GoodsSaleGT;
import cn.com.dashihui.web.dao.GoodsSaleItem;
import cn.com.dashihui.web.dao.GoodsSaleOption;
import cn.com.dashihui.web.dao.GoodsSaleSpec;
import cn.com.dashihui.web.dao.GoodsSaleTemplate;
import cn.com.dashihui.web.dao.GoodsStore;
import cn.com.dashihui.web.dao.GoodsStoreRel;
import cn.com.dashihui.web.dao.GoodsTag;
import cn.com.dashihui.web.dao.GoodsToker;
import cn.com.dashihui.web.dao.GoodsTokerValue;
import cn.com.dashihui.web.dao.Logistics;
import cn.com.dashihui.web.dao.Order;
import cn.com.dashihui.web.dao.OrderLog;
import cn.com.dashihui.web.dao.OrderLogistics;
import cn.com.dashihui.web.dao.OrderRefund;
import cn.com.dashihui.web.dao.OrderRefundAPIRecord;
import cn.com.dashihui.web.dao.Pref;
import cn.com.dashihui.web.dao.Recommend;
import cn.com.dashihui.web.dao.Refound;
import cn.com.dashihui.web.dao.Resource;
import cn.com.dashihui.web.dao.Role;
import cn.com.dashihui.web.dao.SMS;
import cn.com.dashihui.web.dao.Seller;
import cn.com.dashihui.web.dao.SendSeller;
import cn.com.dashihui.web.dao.SpikeList;
import cn.com.dashihui.web.dao.SpikeTime;
import cn.com.dashihui.web.dao.Store;
import cn.com.dashihui.web.dao.StoreAd;
import cn.com.dashihui.web.dao.StoreImages;
import cn.com.dashihui.web.dao.Strategy;
import cn.com.dashihui.web.dao.SysConfig;
import cn.com.dashihui.web.dao.User;
import cn.com.dashihui.web.dao.UserChange;
import cn.com.dashihui.web.dao.UserChangeExcel;
import cn.com.dashihui.web.dao.UserMess;
import cn.com.dashihui.web.dao.UserMoney;
import cn.com.dashihui.web.dao.UserValueLog;
import cn.com.dashihui.web.dao.Version;
import cn.com.dashihui.web.dao.VideoGoods;
import cn.com.dashihui.web.dao.WebJoin;
import cn.com.dashihui.web.dao.WebNotice;
import cn.com.dashihui.web.dao.WxArticle;
import cn.com.dashihui.web.dao.WxArticleCategory;
import cn.com.dashihui.web.dao.WxGoodsTitle;
import cn.com.dashihui.web.dao.WxHomeWindow;
import cn.com.dashihui.web.handler.ContextParamsHandler;
import cn.com.dashihui.web.handler.SessionHandler;

public class Config extends JFinalConfig {
	
	private Routes routes;
	
	@Override
	public void configConstant(Constants me) {
		// 如果生产环境配置文件存在，则优先加载该配置，否则加载开发环境配置文件

//		loadPropertyFile("config.local.properties");//本地
		loadPropertyFile("config.properties");//本地线上联调
//		loadPropertyFile("config.test.properties");//模拟服务器
//		loadPropertyFile("config.server.properties");//服务器

		//设置字符集
		me.setEncoding("UTF-8");
		me.setViewType(ViewType.JSP);
		//上传文件大小
		me.setMaxPostSize(100*Const.DEFAULT_MAX_POST_SIZE);
		//调试模式，会打印详细日志
		me.setDevMode(getPropertyToBoolean("constants.devMode", false));
		//上传文件配置
		//注：此处的目录是上级目录，真正在Controller中获取上传的文件时，需要指定（也可以不指定）要将文件移到什么目录下（）相对于此处指定的目录
		//比如在此设置目录为<E:/>，而在Controller中<getFile("fileName","upload")>，则会将文件移至<E:/upload>目录中，如果不指定则移至<E:/>目录中
//		me.setBaseDownloadPath(PathKit.getWebRootPath()+File.separator+"upload");
//		OreillyCos.init(PathKit.getWebRootPath()+File.separator+"upload", 10*1024*1024, "UTF-8");
		
		//出错跳转页面
		me.setError401View("/WEB-INF/page/401.jsp");
		me.setError403View("/WEB-INF/page/403.jsp");
		me.setError404View("/WEB-INF/page/404.jsp");
		me.setError500View("/WEB-INF/page/500.jsp");
	}
	/**
	 * 重写父类方法
	 */
	@Override
	public Properties loadPropertyFile(String fileName) {
		PropKit.useFirstFound(fileName); 
		return loadPropertyFile(fileName, Const.DEFAULT_ENCODING);
	}
	@Override
	public void configRoute(Routes me) {
		this.routes = me;
		//设置视图根目录
		me.setBaseViewPath("/WEB-INF/page");
		//api
		me.add("/api",APIController.class);
		//权限系列
		me.add("/", SystemController.class);
		me.add("/auth/admin", AdminController.class);
		me.add("/auth/role", RoleController.class);
		me.add("/auth/resource", ResourceController.class);
		//字典系列
		me.add("/dict/city", CityController.class);
		//商品管理
		me.add("/bus/ad", AdController.class);
		me.add("/bus/goods/base",GoodsBaseController.class);
		
		me.add("/bus/goods/store",GoodsStoreController.class);
		me.add("/bus/goods/tag",GoodsTagController.class);
		me.add("/dict/category", CategoryController.class);
		me.add("/bus/user", UserController.class);
		me.add("/bus/order",OrderController.class);
		me.add("/bus/goods/baby",BabyController.class);
		me.add("/pref",PrefController.class);
		//电子卡
		me.add("/ecard/goods",EcardGoodsController.class);
		me.add("/ecard/order",EcardOrderController.class);
		//电子卡
		me.add("/video/goods",VideoGoodsController.class);
		me.add("/video/order",VideoOrderController.class);
		//积分转换
		me.add("/change/delivery",ChangeDeliveryController.class);
		me.add("/change/scale",ChangeDeliveryController.class);
		me.add("/change/history",ChangeSyncController.class);
		me.add("/change/sync",ChangeSyncController.class);
		//余额转换
		me.add("/change/money",ChangeMoneyController.class);
		
		//兑换商品
		me.add("/exchange/goods",ExchangeGoodsController.class);
		me.add("/exchange/order",ExchangeOrderController.class);
		
		me.add("/bus/goods/bestselling",BestSellingController.class);
		//公司管理
		me.add("/dict/store", StoreController.class);
		me.add("/dict/seller", SellerController.class);
		me.add("/dict/store/tong", StoreTongController.class);
		me.add("/dict/seller/tong", SellerTongController.class);
		
		//促销秒杀活动
		me.add("/spike/time",SpikeTimeController.class);
		me.add("/spike/list",SpikeListController.class);
		me.add("/spike/recommend",SpikeRecommendController.class);
		me.add("/spike/recommend/brand",SpikeRecommendController.class);

		//内容
		me.add("/contents/assist",ContentsAssistController.class);
		me.add("/contents/assistcategory",ContentsAssistCategoryController.class);
		me.add("/contents/category",ContentsCategoryController.class);
		me.add("/contents/report",ContentsReportController.class);
		me.add("/contents/selected",ContentsSelectedController.class);
		me.add("/contents/subject",ContentsSubjectController.class);
		me.add("/contents/topic",ContentsTopicController.class);
		
		//系统设置
		/*me.add("/sys/version",VersionController.class);
		me.add("/sys/feedback",FeedbackController.class);*/
		me.add("/sys/config",SysConfigController.class);
		me.add("/sys/sms",SMSController.class);
		/*//日志
		me.add("/log/keyword",LogKeywordController.class);*/
		//WEB业务系列
		me.add("/web/notice",WebNoticeController.class);
		me.add("/web/join",WebJoinController.class);
		//微信文章模块
		me.add("/wx/article/category",WxArticleCategoryController.class);
		me.add("/wx/article",WxArticleController.class);
		me.add("/wx/article/output",WxArticleOutputController.class);
		me.add("/wx/article/strategy",WxStrategyController.class);
		//钱包明细
		me.add("/bus/money", UserMoneyController.class);

		//首页弹窗
		me.add("/wx/homeWindow", WxHomeWindowController.class);
		//商品标签管理
		me.add("/wx/goodsTitle", WxGoodsTitleController.class);
		//登录下载统计
		me.add("/auth/authDownload", AuthDownloadController.class);
		//后台数据统计
		me.add("/bus/data", UserDataController.class);
	}
	
	@Override
	public void configPlugin(Plugins me) {
		//缓存
		EhCachePlugin ecp = new EhCachePlugin();
		me.add(ecp);
		/**
		 * mysql
		 */
		// 配置C3p0数据库连接池插件
		C3p0Plugin mysql = new C3p0Plugin(getProperty("mysql.db.jdbcUrl"), getProperty("mysql.db.username"), getProperty("mysql.db.password"), getProperty("mysql.db.jdbcDriver"));
		mysql.setMaxPoolSize(getPropertyToInt("mysql.db.maxPoolSize"));
		mysql.setMinPoolSize(getPropertyToInt("mysql.db.minPoolSize"));
		mysql.setInitialPoolSize(getPropertyToInt("mysql.db.initialPoolSize"));
		mysql.setMaxIdleTime(getPropertyToInt("mysql.db.maxIdleTime"));
		mysql.setAcquireIncrement(getPropertyToInt("mysql.db.acquireIncrement"));
		me.add(mysql);
		// 配置ActiveRecord插件
		ActiveRecordPlugin arp_mysql = new ActiveRecordPlugin("mysql", mysql);
		arp_mysql.setDialect(new MysqlDialect());
		//arp.setContainerFactory(new CaseInsensitiveContainerFactory());//忽略大小写
		arp_mysql.setShowSql(true);
		me.add(arp_mysql);
		
		/**
		 * sqlserver
		 */
//		C3p0Plugin sqlserver = new C3p0Plugin(getProperty("sqlserver.db.jdbcUrl"), getProperty("sqlserver.db.username"), getProperty("sqlserver.db.password"), getProperty("sqlserver.db.jdbcDriver"));
//		sqlserver.setMaxPoolSize(getPropertyToInt("sqlserver.db.maxPoolSize"));
//		sqlserver.setMinPoolSize(getPropertyToInt("sqlserver.db.minPoolSize"));
//		sqlserver.setInitialPoolSize(getPropertyToInt("sqlserver.db.initialPoolSize"));
//		sqlserver.setMaxIdleTime(getPropertyToInt("sqlserver.db.maxIdleTime"));
//		sqlserver.setAcquireIncrement(getPropertyToInt("sqlserver.db.acquireIncrement"));
//		me.add(sqlserver);
//		ActiveRecordPlugin arp_sqlserver = new ActiveRecordPlugin("sqlserver", sqlserver);
//		arp_sqlserver.setDialect(new AnsiSqlDialect());
//		me.add(arp_sqlserver);
//		
//		//添加model映射
//		arp_sqlserver.addMapping("VipCards", VipUser.class);
		arp_mysql.addMapping("t_auth_admin", Admin.class);
		arp_mysql.addMapping("t_auth_admin_seller", AdSeller.class);
		arp_mysql.addMapping("t_auth_roles", Role.class);
		arp_mysql.addMapping("t_auth_resources", Resource.class);
		arp_mysql.addMapping("t_dict_city", City.class);
		arp_mysql.addMapping("t_dict_category","categoryId", Category.class);
		arp_mysql.addMapping("t_dict_store", Store.class);
		arp_mysql.addMapping("t_dict_logistics", Logistics.class);
		arp_mysql.addMapping("t_bus_ad", Ad.class);
		arp_mysql.addMapping("t_bus_store_ad", StoreAd.class);
		arp_mysql.addMapping("t_bus_goods", GoodsStore.class);
		//电子卡
		arp_mysql.addMapping("t_bus_goods_ecard", GoodsEcard.class);
		//课程
		arp_mysql.addMapping("t_bus_goods_video", VideoGoods.class);
		//退款
		arp_mysql.addMapping("t_bus_order_refund", Refound.class);
		arp_mysql.addMapping("t_bus_store_images", StoreImages.class);
		arp_mysql.addMapping("t_bus_goods_base_images", GoodsBaseImages.class);
		arp_mysql.addMapping("goods_details_images", DeatiImage.class);
		arp_mysql.addMapping("t_bus_goods_item", GoodsItem.class);
		arp_mysql.addMapping("t_bus_goods_tag", GoodsTag.class);
		arp_mysql.addMapping("t_bus_user", User.class);
		arp_mysql.addMapping("t_bus_order", Order.class);
		arp_mysql.addMapping("t_bus_order_gb", GbOrder.class);
		arp_mysql.addMapping("t_bus_order_act", ExchangeOrder.class);
		arp_mysql.addMapping("t_bus_order_log_act", ExchangeOrderLog.class);
		arp_mysql.addMapping("t_bus_order_log", OrderLog.class);
		arp_mysql.addMapping("t_bus_user_mess", UserMess.class);
		arp_mysql.addMapping("t_bus_user_change", UserChange.class);
		arp_mysql.addMapping("t_bus_user_change_log", UserChangeExcel.class);
		arp_mysql.addMapping("t_bus_user_value_log", UserValueLog.class);
		arp_mysql.addMapping("t_bus_order_refund", OrderRefund.class);
		arp_mysql.addMapping("t_bus_order_refund_apirecord", OrderRefundAPIRecord.class);
		arp_mysql.addMapping("t_bus_seller", Seller.class);
		arp_mysql.addMapping("t_bus_goods_store_rel", GSR.class);
		arp_mysql.addMapping("t_bus_goods_base_baby", Baby.class);
		arp_mysql.addMapping("t_bus_goods_base_baby_title", BabyTitle.class);
		arp_mysql.addMapping("t_pref", Pref.class);
		//SKU相关
		arp_mysql.addMapping("t_bus_goods_store_rel", GoodsStoreRel.class);
		arp_mysql.addMapping("t_bus_goods_sale", GoodsSale.class);
		arp_mysql.addMapping("t_bus_goods_sale_spec", GoodsSaleSpec.class);
		arp_mysql.addMapping("t_bus_goods_sale_template", GoodsSaleTemplate.class);
		arp_mysql.addMapping("t_bus_goods_sale_option", GoodsSaleOption.class);
		arp_mysql.addMapping("t_bus_goods_sale_items", GoodsSaleItem.class);
		arp_mysql.addMapping("t_bus_goods_sale_gt", GoodsSaleGT.class);
		//积分商城
		arp_mysql.addMapping("t_bus_ege_goods", GoodsEge.class);
		arp_mysql.addMapping("t_bus_ege_goods_spec", GoodsEgeSpec.class);
		
		arp_mysql.addMapping("t_sys_version", Version.class);
		arp_mysql.addMapping("t_sys_feedback", Feedback.class);
		arp_mysql.addMapping("t_sys_config", SysConfig.class);
		arp_mysql.addMapping("t_wx_article_category", WxArticleCategory.class);
		arp_mysql.addMapping("t_wx_article", WxArticle.class);
		arp_mysql.addMapping("t_wx_strategy", Strategy.class);
		arp_mysql.addMapping("t_web_notice", WebNotice.class);
		arp_mysql.addMapping("t_web_join", WebJoin.class);
		arp_mysql.addMapping("t_sys_sms", SMS.class);
		//秒杀活动
		arp_mysql.addMapping("t_spike_time", SpikeTime.class);
		arp_mysql.addMapping("t_spike_list", SpikeList.class);
		arp_mysql.addMapping("t_spike_recommend", Recommend.class);
		//商品拓客信息
		arp_mysql.addMapping("t_bus_goods_toker", GoodsToker.class);
		arp_mysql.addMapping("t_bus_order_toker_user_log", GoodsTokerValue.class);
		//物流相关
		arp_mysql.addMapping("t_dict_sendseller", SendSeller.class);
		arp_mysql.addMapping("t_bus_order_logistics", OrderLogistics.class);

		//内容
		arp_mysql.addMapping("t_contents_assist",ContentsAssist.class);
		arp_mysql.addMapping("t_contents_assistcategory",ContentsAssistCategory.class );
		arp_mysql.addMapping("t_contents_category",ContentsCategory.class );
//		arp_mysql.addMapping("t_contents_report",ContentsReport.class );
//		arp_mysql.addMapping("t_contents_selected",ContentsSelected.class );
		arp_mysql.addMapping("t_contents_subject",ContentsSubject.class );
//		arp_mysql.addMapping("t_contents_topic",ContentsTopic.class );
		
		arp_mysql.addMapping("goods_details_images", DetailsImg.class);
		
		arp_mysql.addMapping("t_wx_article", WxArticle.class);
		arp_mysql.addMapping("t_wx_strategy", Strategy.class);
		//钱包明细
		arp_mysql.addMapping("t_bus_user_money", UserMoney.class);
		//首页弹窗
		arp_mysql.addMapping("t_bus_home_window", WxHomeWindow.class);
		//商品标签管理
		arp_mysql.addMapping("t_bus_goods_title", WxGoodsTitle.class);
		//登录下载统计
		arp_mysql.addMapping("t_auth_download", AuthDownload.class);
		//shiro权限框架，添加到plugin
		ShiroPlugin shiroPlugin = new ShiroPlugin(this.routes);
		shiroPlugin.setLoginUrl("/login");
		shiroPlugin.setSuccessUrl("/index");
		shiroPlugin.setUnauthorizedUrl("/error403");
		me.add(shiroPlugin);
	}
	
	@Override
	public void configInterceptor(Interceptors me) {
		me.add(new SessionInViewInterceptor());
		me.add(new ShiroInterceptor());
	}
	
	@Override
	public void configHandler(Handlers me) {
		//可在此设置context_path，解决http://ip:port/context_path的问题
		//因为测试时是在jetty下，所以默认没有context_path，如果部署在tomcat下，会自动加上项目名，所以会用到该配置
		//可自定义context_path，默认下是CONTEXT_PATH，使用如：${CONTEXT_PATH}
		me.add(new ContextPathHandler("BASE_PATH"));
		//需要在页面传递的常量
		Map<String,Object> params = Maps.newHashMap();
		params.put("FTP_PATH", PropKit.get("constants.ftppath"));
		me.add(new ContextParamsHandler(params));
		me.add(new SessionHandler());
	}
	
	@Override
	public void afterJFinalStart() {
		super.afterJFinalStart();
		
		//定时任务 同步数据
//		SynchronizationDate task = new SynchronizationDate();
//		NFDFlightDataTimerTask time= new NFDFlightDataTimerTask();
//        ScheduledThreadPoolExecutor taskScheduler = new ScheduledThreadPoolExecutor(1);
//        if(!PropKit.getBoolean("constants.devMode")){
////        	taskScheduler.scheduleAtFixedRate(task, 0, 30000, TimeUnit.SECONDS);
//        	taskScheduler.scheduleAtFixedRate(time, 0, 600000, TimeUnit.SECONDS);
//          }
		//初始化时缓存公众号参数
		ApiConfig ac = new ApiConfig();
		// 配置微信 API 相关常量
		ac.setToken(PropKit.get("wx.token"));
		ac.setAppId(PropKit.get("wx.appId"));
		ac.setAppSecret(PropKit.get("wx.appSecret"));
		// 将 ApiConfig 对象与当前线程绑定，以便在后续操作中方便获取该对象： ApiConfigKit.getApiConfig();
		ApiConfigKit.setDevMode(PropKit.getBoolean("constants.devMode", false));
		ApiConfigKit.setApiConfig(ac);
	}

	@Override
	public void configEngine(Engine me) {
		// TODO Auto-generated method stub
		
	}
	
	
	
}